package com.zhangdi.demo.es.service;

//import com.zhangdi.demo.es.mongorepository.UserRepository;
import com.iowl.search.dto.Company;
import com.zhangdi.demo.es.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhangdi on 2020/06/29 16:02:54.
 */

@Service
public class UserServiceImpl implements UserService {
//    @Autowired
//    UserRepository userRepository;

//    @Autowired
//    MongoTemplate mongoTemplate;

    @Autowired
    ESUserService esUserService;

    @Transactional
    @Override
    public Response<Company> add(Company company) {
//        Region s = userRepository.insert(region);
//        esUserService.save(s);

//        return ResponseUtils.success(s);
        return null;
    }

    @Override
    public List<Company> list() {
//        return mongoTemplate.findAll(Company.class);
//        return userRepository.findAll();
        return null;
    }

    public List<Company> findById(List<String> ids) {
//        Iterable<Region> regions = userRepository.findAllById(ids);
        List<Company> list = new ArrayList<>();
//        for (Region region : regions) {
//            list.add(region);
//        }

        return list;
    }
}
